<template>
  <div class="player">
  <div class="loading" v-if="loading">loading</div>
  <div class="error" v-if="error">error</div>
   <p v-bind:class="{active:isActive}">{{ player  }}</p>
   <!-- <div id="plv_02bfeb00e2ba940698c54cdf517aa9b6_0"></div> -->
  </div>
</template>
<style lang="less" >
@import '~vux/src/styles/reset.less';
@import '~vux/src/styles/1px.less';
@import '~vux/src/styles/tap.less';

.player 	{

}
</style>

<script>
  // import what from 'what'
  // import player from 'https://cdn.bootcss.com/Chart.js/2.5.0/Chart.bundle.js'
import Vue from 'vue'
// Vue.use(what)
  var player = polyvObject('#plv_02bfeb00e2ba940698c54cdf517aa9b6_0').videoPlayer({
      'width':'708',
      'height':'490',
      'hideRepeat':false,
      'vid' : 'e6563d65b05f05c5684d2fd71dd209a4_e'
      });

function nextVideo()
{
  player.changeVid("02bfeb00e27ff92a76364b16af2f115e_0",0,"on");
}

function s2j_onPlayOver()
{
   nextVideo();
}
import { Tab, TabItem, XButton, TransferDom} from 'vux'
export default {
  data () {
    return {
  loading: false,
    post: null,
    error: null,
    player:false,
    isActive:false,
     fetchplaylist:{
       actionName:"player",
       url: 'baseapi',
       postData: {

       }
     }
    }
  },
  created () {
  alert('plaery')
  },
  directives: {
    TransferDom
  },
  components: {
    Tab, TabItem,
    XButton
  },
  methods: {
    play(){
       this.$store.commit('restful_api',this.fetchplaylistfetchplaylist)
    }
  },
  beforeDestory () {

  },
  watch: {
  },
  computed: {
    playlist(){
      return this.$store.getters.all_playlist
    }
  },
  mounted () {
     this.$nextTick(function(){
  Event.listen("isplayer",(e) =>{
         this.$vux.alert.show({
          title: 'playing now',
          content: this.$t(e),
          onShow () {
      console.log('Plugin: I\'m showing')
          },
          onHide () {
      console.log('Plugin: I\'m hiding  now')
          }
      })

  })
     })
     this.handler = () => {
       if(this.path ==='/player') {
       }
     }
  }
}
</script>

